import React from 'react';
import GUtils from "@/utils";
import {Link} from "react-router-dom";

const Config = (Action) => {
    const Handlers = {}
    const columns = [

        {title: "UID", dataIndex: "uid", width: 120, render:(v,vo)=><Link to={`detail/view?id=${vo.uid}`}>{v}</Link>},
        {title: "起付金额", dataIndex: "startPrice", width: 120},
        {title: "起始时间", dataIndex: "startMinute", width: 120},
        {title: "每分钟单价", dataIndex: "minutePrice", width: 120},
        {title: "计费说明", dataIndex: "billingInstructions", width: 240},
        {title: "状态", dataIndex: "enabled", width: 80, render: GUtils.renderEnabledValue},


        {
            title: '操作', dataIndex: 'id', width: 150, render(id, vo) {
                let {enabled} = vo;
                return <div>
                    {GUtils.renderDetailLink(id, "mr-8")}
                    {GUtils.renderEditLink(id, "mr-8")}
                    {vo.enabled} {GUtils.renderEnabledLink(vo, "洗车产品", "uid", Action)}

                    <span className="mr-8"></span>
                    {GUtils.renderDeleteLink(vo, "洗车产品", "uid", Action)}
                </div>
            }
        },

        GUtils.renderSortOpCol(Action, "uid")
    ];
    return {
        ...window.CONFIG.getPagerConfig(Action), columns
    };
};


export default Config;
